package encode

import java.security.MessageDigest
import sun.misc.BASE64Encoder
/**
 * Created by admin on 2015/10/15.
 */
class PasswordCodec {

    static encode ={str ->
        MessageDigest md=MessageDigest.getInstance('SHA')
        md.update(str.getBytes('UTF-8'))
        return (new BASE64Encoder()).encode(md.digest())
    }
}
